package com.woniuxy.patrol.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalTime;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 巡更计划表
 * @TableName wcm_patrol_plan
 */
@TableName(value ="wcm_patrol_plan")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PatrolPlan implements Serializable {
    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    private Long planId;

    /**
     * 计划名称
     */
    private String planName;

    /**
     * 所属社区
     */
    private Long communityId;

    /**
     * 社区名
     */
    private String communityName;

    /**
     * 执行员工id
     */
    private Long executorId;

    /**
     * 计划执行人
     */
    private String executorName;

    /**
     * 执行人邮箱
     */
    private String executorEmail;

    /**
     * 巡更周期，如每日/每周/每月/每年
     */
    private String cycle;

    /**
     * 规则值：每日为空，每周为1,3,5，每月为1,15
     */
    private String cycleRule;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态，1=启用,0=停用
     */
    private Integer status;

    /**
     * 是否删除，0删除 1存在
     */
    private Integer isDelete;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    private Date updateTime;
    /**
     * 计划类型，1=巡更计划，2=巡更任务
     */
    private Integer planType;
    /**
     * 每日计划开始时间（时分，如08:00，对应《巡更技术需求.docx》3.5.2节）
     */
    @TableField("daily_start_time")
    private LocalTime dailyStartTime; // 新增字段

    /**
     * 每日计划结束时间（时分，如18:00，对应《巡更技术需求.docx》3.5.2节）
     */
    @TableField("daily_end_time")
    private LocalTime dailyEndTime; // 新增字段

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PatrolPlan other = (PatrolPlan) that;
        return (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getPlanName() == null ? other.getPlanName() == null : this.getPlanName().equals(other.getPlanName()))
            && (this.getCommunityId() == null ? other.getCommunityId() == null : this.getCommunityId().equals(other.getCommunityId()))
            && (this.getCommunityName() == null ? other.getCommunityName() == null : this.getCommunityName().equals(other.getCommunityName()))
            && (this.getExecutorId() == null ? other.getExecutorId() == null : this.getExecutorId().equals(other.getExecutorId()))
            && (this.getExecutorName() == null ? other.getExecutorName() == null : this.getExecutorName().equals(other.getExecutorName()))
            && (this.getExecutorEmail() == null ? other.getExecutorEmail() == null : this.getExecutorEmail().equals(other.getExecutorEmail()))
            && (this.getCycle() == null ? other.getCycle() == null : this.getCycle().equals(other.getCycle()))
            && (this.getCycleRule() == null ? other.getCycleRule() == null : this.getCycleRule().equals(other.getCycleRule()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getPlanName() == null) ? 0 : getPlanName().hashCode());
        result = prime * result + ((getCommunityId() == null) ? 0 : getCommunityId().hashCode());
        result = prime * result + ((getCommunityName() == null) ? 0 : getCommunityName().hashCode());
        result = prime * result + ((getExecutorId() == null) ? 0 : getExecutorId().hashCode());
        result = prime * result + ((getExecutorName() == null) ? 0 : getExecutorName().hashCode());
        result = prime * result + ((getExecutorEmail() == null) ? 0 : getExecutorEmail().hashCode());
        result = prime * result + ((getCycle() == null) ? 0 : getCycle().hashCode());
        result = prime * result + ((getCycleRule() == null) ? 0 : getCycleRule().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", planId=").append(planId);
        sb.append(", planName=").append(planName);
        sb.append(", communityId=").append(communityId);
        sb.append(", communityName=").append(communityName);
        sb.append(", executorId=").append(executorId);
        sb.append(", executorName=").append(executorName);
        sb.append(", executorEmail=").append(executorEmail);
        sb.append(", cycle=").append(cycle);
        sb.append(", cycleRule=").append(cycleRule);
        sb.append(", startTime=").append(startTime);
        sb.append(", remark=").append(remark);
        sb.append(", status=").append(status);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }



}